<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/view/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">      	
  	  <link rel="stylesheet" type="text/css" href="./estilos.css"/>
  	  
<h:form id="formEditarAvaliacaoFisica">  
	<p:panel id="panelEditarAvaliacaoFisica" header="Editar AvaliacaoFisica" style="margin-bottom:20px; ">  
	<f:facet name="header">
		<h:outputText value="Editar Avaliação Física" styleClass="outputTextTitulo"/>
	</f:facet>
 	<p:messages id="messages" autoUpdate="true"/> 
 		<h:panelGrid columns="1">
 			<h:outputLabel value="*Protocolo Utilizado: Pollock - 7 Dobras Cutâneas" />
 		</h:panelGrid>
    	<h:panelGrid  columns="2" style="margin-top:20px; margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>     
            <h:outputLabel value="Data" styleClass="outputLabel"/>           
            <p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.idAvaliacaoFisica}" styleClass="inputId" disabled="true"/>                         
            <p:inputMask value="#{avaliacaoFisicaBean.avaliacaoFisica.dtAvaliacao}" mask="99/99/9999" styleClass="inputData" >
            	<f:convertDateTime dateStyle="medium"/>
            </p:inputMask>  
        </h:panelGrid>  
        <h:panelGrid id="pgProfessor" columns="3">
        	<h:outputLabel value="Código" styleClass="outputLabel"/>
        	<h:outputLabel value="Professor" styleClass="outputLabel"/>
        	<h:outputLabel  />
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.funcionario.idFuncionario}" styleClass="inputId" /> 
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.funcionario.nome}" maxlength="40"  styleClass="inputDescricao" /> 
        	<p:commandButton icon="ui-icon-search" actionListener="#{avaliacaoFisicaBean.openDialogProfessor}" immediate="true"/>
        </h:panelGrid>
        <h:panelGrid id="pgAluno" columns="3">
        	<h:outputLabel value="Código" styleClass="outputLabel"/>
        	<h:outputLabel value="Aluno" styleClass="outputLabel"/>
        	<h:outputLabel />
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.aluno.idAluno}" styleClass="inputId" disabled="true"/> 
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.aluno.nome}" maxlength="40" styleClass="inputDescricao" required="true" requiredMessage="Selecione um aluno!" disabled="true"/> 
        	<p:commandButton icon="ui-icon-search" actionListener="#{avaliacaoFisicaBean.openDialogConsultarAluno}" immediate="true"/>
        </h:panelGrid>
        <h:panelGrid columns="2" >    
		  	<h:outputLabel value="Peso(Kg)"  styleClass="outputLabel"/>
        	<h:outputLabel value="Altura" styleClass="outputLabel"/>
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.peso}" maxlength="5"  styleClass="inputId" required="true" requiredMessage="Preencha o peso!"/> 
        	<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.altura}" maxlength="5"  styleClass="inputId" required="true" requiredMessage="Preencha a altura!"/> 
   		</h:panelGrid> 
   			<p:fieldset id="fildsetMedidas" legend="Medidas" style="margin-top:10px"> 
				<h:panelGrid columns="6" style="text-align:center; float:center">
					<h:outputLabel value="Dobras" styleClass="outputLabel" style="text-align:center; float:center"/>
					<h:outputLabel value="Medida 1" styleClass="outputLabel" style="text-align:center; float:center"/>
					<h:outputLabel value="Medida 2" styleClass="outputLabel"/>
					<h:outputLabel value="Medida 3" styleClass="outputLabel"/>	
					<h:outputLabel value="Medida Utilizada" styleClass="outputLabel" />	
					<h:outputLabel />
					
					<h:outputLabel value="Subescapular" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.subescapular1}"  styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida subescapular!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.subescapular2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida subescapular!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.subescapular3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida subescapular"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.subescapular}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Axilar Média" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.axilarMedia1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Axilar Média!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.axilarMedia2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Axilar Média!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.axilarMedia3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Axilar Média!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.axilarMedia}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Tríceps" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.triceps1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Tríceps!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.triceps2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Tríceps!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.triceps3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Tríceps!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.triceps}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Coxa" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.coxa1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Coxa!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.coxa2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Coxa!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.coxa3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Coxa!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.coxa}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Supra ilíaca" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.supraIliaca1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Supra Ilíaca!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.supraIliaca2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Supra Ilíaca!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.supraIliaca3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Supra Ilíaca!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.supraIliaca}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Abdominal" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.abdominal1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Abdominal!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.abdominal2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Abdominal!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.abdominal3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Abdominal!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.abdominal}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<h:outputLabel />
					
					<h:outputLabel value="Peitoral" styleClass="outputLabel" style="text-align:right; float:right"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.peitoral1}" styleClass="inputData" required="true" requiredMessage="Preencha a Primeira medida Peitoral!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.peitoral2}" styleClass="inputData" required="true" requiredMessage="Preencha a Segunda medida Peitoral!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.peitoral3}" styleClass="inputData" required="true" requiredMessage="Preencha a Terceira medida Peitoral!"/>
					<p:inputText mask="99.99" value="#{avaliacaoFisicaBean.avaliacaoFisica.peitoral}" styleClass="inputData" disabled="true">
						<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
					</p:inputText>		
					<p:commandButton value="Calcular" actionListener="#{avaliacaoFisicaBean.calcula}" update="messages, fildsetMedidas"/>	
			</h:panelGrid>
			
			<h:panelGrid columns="5">
				<h:outputLabel value="%Gordura" styleClass="outputLabel" />
				<h:outputLabel value="%Massa Magra" styleClass="outputLabel" />
				<h:outputLabel value="%Massa Gorda" styleClass="outputLabel" />
				<h:outputLabel value="Peso Mínimo(Kg)" styleClass="outputLabel" />
				<h:outputLabel value="Peso Máximo(Kg)" styleClass="outputLabel" />
				<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.gordura}" styleClass="inputData" disabled="true">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
				</p:inputText>
				<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.massaMagra}" styleClass="inputData" disabled="true">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
				</p:inputText>
				<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.massaGorda}" styleClass="inputData" disabled="true">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
				</p:inputText>
				<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.pesoMinimo}" styleClass="inputData" disabled="true">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
				</p:inputText>
				<p:inputText value="#{avaliacaoFisicaBean.avaliacaoFisica.pesoMaximo}" styleClass="inputData" disabled="true">
					<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
				</p:inputText>
			</h:panelGrid>
		</p:fieldset>

    </p:panel>  
    <p:commandButton value="Salvar" actionListener="#{avaliacaoFisicaBean.saveAvaliacaoFisica}" update="panelEditarAvaliacaoFisica,messages" style="margin-right:20px; margin-left:10px;" /> 
	<p:commandButton value="Cancelar" style="margin-right:20px;" /> 
</h:form>  	
<ui:include src="/view/avaliacaoFisica/dialogProfessor.xhtml"></ui:include>
<ui:include src="/view/avaliacaoFisica/dialogConsultarAluno.xhtml"></ui:include>

</ui:define>
</ui:composition>
